package com.sunmouse.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolUtil {
	private static ThreadPoolUtil mUtil;
	private ExecutorService mService;
	private ThreadPoolUtil() {
		super();
		mService=Executors.newFixedThreadPool(10);
	}
	
	
	
	/**
	 *instance factory 
	 */
	public static ThreadPoolUtil getInstance(){
		if(mUtil==null){
			mUtil=new ThreadPoolUtil();
		}
		return mUtil;
	}
	
	/**
	 * execute task
	 */
	public void execute(Runnable task){
		this.mService.execute(task);
	}

}
